#coding=utf-8
'''
Created on 2017-7-15

@author: sandy
'''

import logging

class Table(object):
    def __init__(self):
        self.users = [];
        self.ownerId = 0
        self.tableId = 0
        self.gameId = 0
        self.gameIp = u''
        self.gamePort = 0
        self.maxRound = 0
        self.curRound = 0
        self.tableModel = 4
        self.playModel = 0
        self.hallId = 0
        self.cardId = 0
        self.cardNum = 0


    def createTable(self,userId,tableId,gameIp,gamePort,maxRound,tableModel,playModel,cardId,cardNum,hallId):
        self.ownerId = userId
        self.tableId = tableId
        self.gameIp = gameIp
        self.gamePort = gamePort
        self.maxRound = maxRound
        self.tableModel = tableModel
        self.playModel = playModel
        self.hallId = hallId
        self.cardId = cardId
        self.cardNum = cardNum

    def userEnterTable(self,userId):
        logging.debug("uid=%d userEnterTable tableId = %d",userId,self.tableId)
        self.users.append(userId)

    def userLeaveTable(self,userId):
        logging.debug("uid=%d userLeaveTable tableId = %d",userId,self.tableId)
        self.users.remove(userId)
            
    def getUsers(self):
        return self.users    

    def delTable(self):
        self.users = []
            


if "__name__" == "__main__":
    pass
